package com.beluga.mybatis.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.beluga.mybatis.mapper.WxShopMapper;
import com.beluga.mybatis.service.WxShopService;
import com.beluga.mybatis.entity.WxShop;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@Service
public class WxShopServiceImpl extends ServiceImpl<WxShopMapper, WxShop> implements WxShopService {


    @Override
    public void testmybatis() {
        List<WxShop> l=new ArrayList<>();
        WxShop s=new WxShop();
        s.setId(22l);
        s.setShopName("测试mybatis2");
        l.add(s);
        WxShop ss=new WxShop();
        ss.setId(21l);
        ss.setShopName("测试mybatis1");
        ss.setShopIcon("11");
        l.add(ss);
        // 开始时间
        long start = System.currentTimeMillis();
        // 执⾏时间（1s）
        this.baseMapper.insertBatch(l);
        System.out.println("insertBatch自定义插件 执⾏时长："+ (System.currentTimeMillis() - start) + "毫秒");






        //
        //this.baseMapper.insertIgnore(ss);
    }
}